// stock10.h -- Stock class declaration with constructors, destructor added

#ifndef STARTCPP_STOCK_H
#define STARTCPP_STOCK_H 10

#include <string>

class Stock {
private:
    std::string company;
    long shares;
    double share_val;
    double total_val;

    void set_tot() { total_val = share_val * shares; }

public:
    // two constructors
    Stock();    // default constructor
    Stock(const std::string &co, long n = 0, double pr = 0.0);

    ~Stock();   // noisy destructor
    void acquire(const std::string &co, long n, double pr);

    void buy(long num, double price);

    void sell(long num, double price);

    void update(double price);

    void show() const; // promises not to change invoking object
    const Stock & topval(const Stock & s) const;
};

#endif //STARTCPP_STOCK_H
